#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Server Enumerator Class
 *      Provides methods for enumerating the server types on the local network.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
#include "ServerInformation.h"

using namespace System;

namespace Adaptive
{
	namespace Win32
	{
		namespace Network
		{
			/// <summary>
			/// Provides methods for enumerating the server types on the local network.
			/// </summary>
			public ref class ServerEnumerator sealed
			{
			public:
	 
				/*--------------------------------------------------------------------------------
				 * Public Methods / Functions
				 *------------------------------------------------------------------------------*/
				#pragma region Public Methods / Functions
				/// <summary>
				/// Lists the workstations on the local network.
				/// </summary>
				/// <returns>
				/// A <see cref="ServerInformation"/> array containing the list of machines on the network.
				/// </returns>
				static array<ServerInformation>^ EnumerateWorkstations(String^ domain);
				/// <summary>
				/// Lists the servers on the local network.
				/// </summary>
				/// <returns>
				/// A <see cref="ServerInformation"/> array containing the list of machines on the network.
				/// </returns>
				static array<ServerInformation>^ EnumerateServers(String^ domain);
				/// <summary>
				/// Lists the SQL Servers on the local network.
				/// </summary>
				/// <returns>
				/// A <see cref="ServerInformation"/> array containing the list of machines on the network.
				/// </returns>
				static array<ServerInformation>^ EnumerateSqlServers(String^ domain);
				/// <summary>
				/// Lists the primary domain controllers on the local network.
				/// </summary>
				/// <returns>
				/// A <see cref="ServerInformation"/> array containing the list of machines on the network.
				/// </returns>
				static array<ServerInformation>^ EnumeratePrimaryDcs(String^ domain);
				/// <summary>
				/// Lists the backup domain controllers on the local network.
				/// </summary>
				/// <returns>
				/// A <see cref="ServerInformation"/> array containing the list of machines on the network.
				/// </returns>
				static array<ServerInformation>^ EnumerateBackupDcs(String^ domain);
				/// <summary>
				/// Lists the NT Servers on the local network.
				/// </summary>
				/// <returns>
				/// A <see cref="ServerInformation"/> array containing the list of machines on the network.
				/// </returns>
				static array<ServerInformation>^ EnumerateNtServers(String^ domain);
				/// <summary>
				/// Lists the all the machines on the local network.
				/// </summary>
				/// <returns>
				/// A <see cref="ServerInformation"/> array containing the list of machines on the network.
				/// </returns>
				static array<ServerInformation>^ EnumerateAll(String^ domain);
				/// <summary>
				/// Lists the machines on the local network of the specified server type.
				/// </summary>
				/// <param name="typeOfServer">A <see cref="ServerType"/> enumerated value indicating the 
				/// type(s) of servers and/or workstations to be enumerated.</param>
				/// <returns>
				/// A <see cref="ServerInformation"/> array containing the list of machines on the network.
				/// </returns>
				static array<ServerInformation>^ EnumerateByType( ServerType typeOfServer, String^ domain );

				#pragma endregion

			private:
				/*--------------------------------------------------------------------------------
				 * Constructor / Dispose / Destructor Methods
				 *------------------------------------------------------------------------------*/
				#pragma region Constructor / Dispose / Destructor Methods
				/// <summary>
				/// Initializes a new instance of the class.
				/// </summary>
				/// <remarks>
				/// This constructor is hidden to prevent instantiation.
				/// </remarks>
				ServerEnumerator();

				static array<ServerInformation>^ UnmanagedEnumerate(int serverType, String^ domain);
				#pragma endregion


			};
		}
	}
}